local mex = piece "mex" --The extractor itself.
local head = piece "head" --The head of the clone.
local neck = piece "neck" --The neck of the clone.
local body = piece "torso" --The torso of the clone.
local arm_left = piece "armleft" --The left arm.
local pistol = piece "handpistol" --The weapon.
local weapon1 = piece "weapon1" --The point the shots emerge from.
local arm_right = piece "armright" --The right arm.
local hand_right = piece "handright" --The right hand.

function script.Create()

end

---WALKING---
local function walk()

end

function script.StartMoving()

end

function script.StopMoving()

end

---AIMING & SHOOTING---
function script.AimFromWeapon1() 
	return body
end

function script.QueryWeapon1() 
	return weapon1
end

--must return true to allow the weapon to shot. return false denies the weapon from shooting
--can be used delay the shooting until a "turn turret" animation is completed
function script.AimWeapon1( heading, pitch )
	--make sure the aiming animation is only run once
	Signal(SIG_AIM)
	SetSignalMask(SIG_AIM)
	Turn(head, y_axis, heading, math.rad(90))
	--wait until the weapon is pointed in the right direction
	WaitForTurn (head, y_axis)
	return true
end

--called after the weapon has fired
function script.FireWeapon1()
	
end

----death animation: fall over & explode
function script.Killed(recentDamage, maxHealth)
	Turn(mex, x_axis, math.rad(90),math.rad(150))
	WaitForTurn (mex, x_axis)
	Explode (body, SFX.SHATTER)
	explode (mex, SFX.FIRE)
end
----------------
